#include"udpserver.hpp"
#include<iostream>
#include<memory>
#include"Route.hpp"
#include"mypthreadpool.hpp"
int main(int argc,char* argv[])
{
    if(argc!=2)
    {
        //输入方式错误
        LOG(LogLevel::ERROR)<<"输入方式错误，正确方式为:./udpserver port";
        exit(0);
    }
    uint16_t port=std::stoi(argv[1]);
    //创建一个路由
    Route r;

    udpserver* usvr=new udpserver(port,[&r](int sockfd,std::string message,Addr& cli){
        r.Send(sockfd,message,cli);
    });
    usvr->Init();
    usvr->Start();
    return 0;
}